×
☰ See All Chapters

How to create test cases manually from Selenium IDE

In this tutorial you will learn to create test cases manually from selenium IDE instead of using recording option. We will create steps by inserting selenium commands. We will cover the following below actions in the test case.

  1. Open firefox and type www.google.com  

  2. Type “java4coding” in the Google Search Input Box  

  3. Click Search Button 

Step 1: Launch Firefox and create project

Open Firefox, go to tools, and click on selenium IDE.

creating-test-cases-manually-in-selenium-ide-0
 

Select Create a new project

creating-test-cases-manually-in-selenium-ide-1
 

Enter Project Name and click Ok

creating-test-cases-manually-in-selenium-ide-2
 

Step 2: Create test script to open www.google.com

In Test Script Editor Panel enter the following values.

  1. Command : open 

  2. Target : https://www.google.co.in 

creating-test-cases-manually-in-selenium-ide-3
 

Step 3: Create test script to focus/enter on search box

Now we have to create the command to click on search input text box. Now we have to identify the property which is unique to this input search box. This property should be unique from all the html code which has been rendered. Using this unique property we can create the command to locate the input search field. While identifying the unique property we can consider any attribute of the html tag, or we can frame combination of attributes of the html tag, but final it should be unique from the all html code in the current page.

Most of the time developers attach the id attribute and which will be unique to the page. If id attribute is not present we can consider name, class or any other attributes or combination of attributes to get the unique identification.

To identify the unique identification property we can use browser developer tool to inspect the element. Open  https://www.google.com  browser. Right click on the Google search text box and select Inspect Element.

creating-test-cases-manually-in-selenium-ide-4
 

It will launch a window containing source code of the page and in the code the html tag which is rendering the input search field will be highlighted. Find the attribute name and get the value of it.

creating-test-cases-manually-in-selenium-ide-5
 

In Test Script Editor Panel enter the following values create the command to click on search input text box.

  1. Command : open 

  2. Target : name=q 

creating-test-cases-manually-in-selenium-ide-6
 

Step 4: Create test script to enter search text

Create the command to type java4coding in the search input filed. In Test Script Editor Panel enter the following values create the command to click on search input text box.

  1. Command : type 

  2. Target : name=q 

  3. Value: java4coding 

creating-test-cases-manually-in-selenium-ide-7
 

Step 5: Create test script to click on “Google Search” button

Create the command to click on the “Google Search” button. By using developer’s tool inspect this “Google Search” button and get the unique property of this button. We found name="btnK" is unique to this button.

In Test Script Editor Panel enter the following values create the command to click on search input text box.

  1. Command : click 

  2. Target : name=btnK 

creating-test-cases-manually-in-selenium-ide-8
 

Step 6: Name the test case

Now we have created all the commands. Name the test case; we named it to “Testcase”.  Click on menu, select Rename and name it.

creating-test-cases-manually-in-selenium-ide-9
 

Step 6: Execute the commands

To execute the command enter the Playback Base URL and click on Run button

creating-test-cases-manually-in-selenium-ide-10
 

Check the log panel to see the result.

creating-test-cases-manually-in-selenium-ide-11
 

Note:

  1. Suppose if you wish to update any command select the command and edit from editor panel. 

  2. If you have to add a command in between the commands, right click on the command above which you wish to add command and select “Insert new command” 

creating-test-cases-manually-in-selenium-ide-12
 

Login Test Case

We have created a test site https://www.registration.tools4testing.com/  to try login action.

Please register to this test application https://www.registration.tools4testing.com/, try to create the commands and execute them. Please keep the registration and credential ready, we use this registration application going forward as a test application.

creating-test-cases-manually-in-selenium-ide-13
 

All Chapters
Author